﻿using UnityEngine;
using System.Collections;

public class EnemySpawner : MonoBehaviour {

	private float _t = 0;
	public float _cooldown = 2f;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		this._t += Time.deltaTime;
		
		if(this._t >= this._cooldown)
		{
			// spawn creep
			GameObject creep = Instantiate(Resources.Load("Zombie")) as GameObject;
			creep.transform.position = this.transform.position;
			// reset time
			this._t = 0;
		}
	}
}
